ImagXpress 13 for ActiveX - User Guide > How To > View an Image > Handle End-User Viewing Events |
VB Example |
Copy Code
|
---|---|
// Write the event handler to dispatch the work when the user makes a menu selection Sub IX1_MenuSelect (long menuType, long tool, long topMenuID, long subMenuID, long user1, long user2) if (menuType = MenuContext) then Select Case topMenuID Case 100 ' Color MyObj.Color = user1 Case 200 ' Size MyObj.Size = user1 Case 300 ' Type SelectCase subMenuID Case 310 MyObj.DrawLine Case 320 MyObj.DrawEllipse Case 330 MyObj.DrawRect End Select end if end sub |
The application end-user can change the portion of the image that is viewed in the View Window using scrollbars.
If scrollbars are enabled, then when the scroll bar is clicked, a Scroll event raises to alert the application to a scrolling request. The ScrollBarLargeChangeH, ScrollBarLargeChangeV, ScrollBarSmallChangeH and ScrollBarSmallChangeV properties are set to indicate the amount of requested change to the horizontal and vertical positioning of the view. The view is updated on the next paint.
Track the position of the cursor in the displayed image as follows:
To translate between the coordinates on the displayed image and the coordinates in the DIB, use TranslateX and TranslateY methods. |